package com.woniu.service.Impl;

import com.woniu.dao.CreditExamineDao;
import com.woniu.entity.CreExamine;
import com.woniu.service.CreditExamineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * Service业务层处理
 *
 * @author 陈泓霖
 * @date 2022-09-26
 */
@Service
public class CreditExamineServiceImpl implements CreditExamineService {
    @Autowired
    private CreditExamineDao creditExamineDao;

    /**
     * 查询
     *
     * @param examineId 主键
     * @return
     */
    @Override
    public CreExamine selectCreExamineByExamineId(int examineId)
    {
        return creditExamineDao.selectCreExamineByExamineId(examineId);
    }

    /**
     * 查询列表
     *
     * @param creExamine
     * @return
     */
    @Override
    public List<CreExamine> selectCreExamineList(CreExamine creExamine)
    {
        return creditExamineDao.selectCreExamineList(creExamine);
    }

    /**
     * 新增
     *
     * @param creExamine
     * @return 结果
     */
    @Override
    public int insertCreExamine(CreExamine creExamine)
    {
        return creditExamineDao.insertCreExamine(creExamine);
    }

    /**
     * 修改
     *
     * @param creExamine
     * @return 结果
     */
    @Override
    public int updateCreExamine(CreExamine creExamine)
    {
        return creditExamineDao.updateCreExamine(creExamine);
    }

    /**
     * 批量删除
     *
     * @param examineIds 需要删除的主键
     * @return 结果
     */
    @Override
    public int deleteCreExamineByExamineIds(int[] examineIds)
    {
        return creditExamineDao.deleteCreExamineByExamineIds(examineIds);
    }

    /**
     * 删除信息
     *
     * @param examineId 主键
     * @return 结果
     */
    @Override
    public int deleteCreExamineByExamineId(int examineId)
    {
        return creditExamineDao.deleteCreExamineByExamineId(examineId);
    }

    @Override
    public CreExamine selectCreExamineByOrderId(CreExamine creExamine) {

        List<CreExamine> list = creditExamineDao.selectCreExamineList(creExamine);
        CreExamine creExamine2 = (CreExamine)(list.get(0));
        return creExamine2;
    }
}
